<%@ page language="java" contentType="application/octet-stream;charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.sales.*" %>
<%
	out.clear();
	out = pageContext.pushBody(); 
	
	
	String excelTitle = "견적의뢰";
	
	response.setHeader("Content-Disposition","attachment;filename="+java.net.URLEncoder.encode(excelTitle, "utf-8")+"_"+StringUtil.today()+".xls");
	response.setHeader("Content-Description","JSP Generated Data");
	


	String s_req_dt			= StringUtil.nvl(request.getParameter("s_req_dt"));
	String s_start_dt_from	= StringUtil.nvl(request.getParameter("s_start_dt_from"));
	String s_start_dt_to	= StringUtil.nvl(request.getParameter("s_start_dt_to"));
	String s_req_status		= StringUtil.nvl(request.getParameter("s_req_status"));
	String s_customer_name	= StringUtil.toHan(request.getParameter("s_customer_name"));
	String s_email_addr		= StringUtil.toHan(request.getParameter("s_email_addr"));
	String s_phone_no		= StringUtil.nvl(request.getParameter("s_phone_no"));
	String s_hotel_name		= StringUtil.nvl(request.getParameter("s_hotel_name"));
	String s_enjoy_name		= StringUtil.nvl(request.getParameter("s_enjoy_name"));
	String s_car_company	= StringUtil.nvl(request.getParameter("s_car_company"));

	String s_hotel_chk		= StringUtil.nvl(request.getParameter("s_hotel_chk"));
	String s_enjoy_chk		= StringUtil.nvl(request.getParameter("s_enjoy_chk"));
	String s_car_chk		= StringUtil.nvl(request.getParameter("s_car_chk"));



	HashMap infos = new HashMap();
	infos.put("req_dt",			s_req_dt);
	infos.put("start_dt_from",		s_start_dt_from);
	infos.put("start_dt_to",		s_start_dt_to);
	infos.put("req_status",		s_req_status);
	infos.put("customer_name",	s_customer_name);
	infos.put("email_addr",		s_email_addr);
	infos.put("phone_no",		s_phone_no);
	infos.put("hotel_name",		s_hotel_name);
	infos.put("enjoy_name",		s_enjoy_name);
	infos.put("car_company",		s_car_company);
	infos.put("hotel_chk",		s_hotel_chk);
	infos.put("enjoy_chk",		s_enjoy_chk);
	infos.put("car_chk",		s_car_chk);
	

	SalesDAO dao 	= new SalesDAO();
	HashList list 	= dao.selectReqList(infos);


	list.setHeader("req_id", 			"번호", 	MetaData.ALIGN_CENTER);
	list.setHeader("req_gubn_name", 	"구분",		MetaData.ALIGN_LEFT);
	list.setHeader("req_dt", 			"견적일자",	MetaData.ALIGN_LEFT);
	list.setHeader("customer_name", 	"성명",		MetaData.ALIGN_LEFT);
	list.setHeader("travel_type_name",	"여행일정",	MetaData.ALIGN_LEFT);
	list.setHeader("start_dt", 			"출발일자",	MetaData.ALIGN_CENTER);
	list.setHeader("email_addr", 		"이메일",	MetaData.ALIGN_LEFT);
	list.setHeader("phone_no", 			"연락처",	MetaData.ALIGN_LEFT);
	list.setHeader("req_status_name",	"상태",		MetaData.ALIGN_CENTER);
	
	list.writeToExcel(response, excelTitle);
%>
